require(['./config'],() =>{
	require(['jquery'],() =>{
		class Register{
			constructor() {
				this.getAjax()
			}
			getAjax(){
				$('.login-deng').on('click',() =>{
					let name = $('#inputName').val()
					let pwd = $('#inputPwd').val()
					if( name == ""){
						alert("请输入用户名")
						return false
					}if( pwd == ""){
						alert("请输入密码")
						return false
					}
				$.ajax({
					method:'POST',
					url:'http://localhost/erShop/api/shop/register.php',
					data:{name,pwd},
					success: function (resp) {
					  alert(resp.body.msg+"即将跳转页面")
					  location.href="/html/login.html"
					},
					dataType:'json'
					
				})
				name = ""
				pwd = ""
				})
			}
		}
		new Register()
	})
})